Enabling intellisense in Visual Studio for XML files.

Alex van Buitenen, Mar 2009

You can enable intellisense in Visual Studio for XML files by copying the corresponding schema (XSD file) to:

C:\Program Files\Microsoft Visual Studio 8\Xml\Schemas (location for Visual Studio 2005).

This way intellisense can be enabled for Nant, NHibernate ,etc...

The NHibernate XSD's are included in the NHibernate download.
The NAnt XSD can be produced using this NAnt build-file:

<?xml version="1.0"?>
<
project name="Create NAnt XSD" default="build-nant-schema-for-vs2005">
  <
target name="build-nant-schema-for-vs2005">
    <
nantschema output="NAnt.xsd" target-ns="http://nant.sf.net/release/0.83/nant.xsd"/>
    <
copy todir="C:\Program Files\Microsoft Visual Studio 8\Xml\Schemas" file="NAnt.xsd"/>
    <
delete file ="NAnt.xsd"/>
  </
target>
</
project>

fig 1. The NAnt build-file (CreateNAntXsd.build) to create the NAnt XSD.

This file can be called by the command:

"C:\Program Files\NAnt\bin\NAnt.exe" -buildfile:CreateNAntXsd.build